
I am uploading data from MS dynamix AX (MSDAX) to Salesforce in scheduled batch process. But in 1 case MSDAX sends the data as 10,20,30 which is mapped to Record Type in SFDC.
Ex: Msdax sends the data as 20 in csv then before impoting it should be changed to Record type ID( lets say if it send as 10, then i should map it to record type NorthRegion....if it send as 20 then i should map it to WestRegion 30 EastRegion etc. how can i achieve this... Is it by Workflow or before insert trigger.
Please let me know if any one has idea on this.
Thanks,
Chandrakanth
6 respostas
The trigger is going to be simple though. Sample pseudo code
1. START TRIGGER
2. CREATE MAP OF CUSTGROUP WITH RECORD TYPE IDS. ex mapRecordType = new map <String, String>{'10' => '<SF RECORD TYPE ID of RT1', '20' => '<SF RECORD TYPE ID of RT2'};
3. ITERATE INCOMING RECORDS USING FOR LOOP
3.1 CHECK FOR THE ACTUAL GROUP ON THE RECORD AND FETCH RECORDID USING CREATED MAP
3.2 POPULATE RECORD TYPE ID FIELD
4. END FOR LOOP
5. END TRIGGER
Let us know if you want more details on it.