Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Massive Update CountryRegionId via AX job

$
0
0

Hello  and thank you very much in advance if you can help me with this.

I am devoloping a massive update via AX job to update the field  address.CountryRegionId for certain Vendors.

My intent is to replicate 100% the same logic as a user would amend this manually from the VendTable form.

By debugging the AX code , once the country region ID is amended ,

AX triggers the validatedate field method 

then it triggers the modifiedfield method and as you can notice from the method, 

this.isformdatasource() returns true ( as we are triggering the update from the form)

and by doing that , it will update the field address

The question is how I can "emulate" a call from the form via AX job?

This is the rudimental script I have created to try the logic, but the result is not the one expected as when triggering the modifiedfield()

this.isformdatasource() will return false.

static void Job17(Args _args)
{

address address;

ttsbegin;

select forupdate address where address.recid == 5637187833 ;

{
address.CountryRegionId = 'GD';
address.validatefield(10);
address.modifiedField(10);

address.validatewrite();

address.write();

}

ttscommit;

}

THank you


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>