cancel
Showing results for 
Search instead for 
Did you mean: 

Modify a mdm record by passing blank values

Former Member
0 Kudos

Hi Friends,

I am working with Webdynpro java and using mdm java api to interact with MDM 5.5.

I am modifying a mdm record with blank values and update the data into MDM repository.

For example Name1=" ratnakar" ( type -> text) country =" India" ( type-> lookup -flat) are read from the mdm and the user want to modify by removing the Name1 and country values and will save rocrod by using modifycommand record.

Here i want to know by the time of calling this modify command record java api how can set blank (empty) values to Name1, Country which should replace the actual values in mdm ( "rantakar", "inida" with empty).

i want to know how to handle this scenario and especially with the lookups as it have F4 help values and dont allow blank values.

Could you please provide your ponters on the same.

regards

Dushyant

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If you want to insert blank value to your MDM record, while inserting after modification, just test the condition like if the input field name is not null then only insert into your repository and same for lookup also.

see the code below. If you remove the name, in Webdynpro, it will contain null value. just check the context value and insert new value only if the context is not null.

if(wdContext.currentContextElement().getName_personal()!=null)

{

newRec.setFieldValue(fields[1], new StringValue(wdContext.currentContextElement().getName_personal()));

}

Edited by: prasanthi reddy on Apr 20, 2009 7:34 AM

Edited by: prasanthi reddy on Apr 20, 2009 7:38 AM

Former Member
0 Kudos

Hi Dushyant,,

You can use below code to set empty( blank) value to any type of MDM field (flat,text etc....)

record.setFieldValue("Field ID'', NullValue.NULL);

Please let me know if it helps.

Thanks & Regards,

Veeru.

Former Member
0 Kudos

Hi All,

At the time of saving data into mdm i am doing null check and after setting the values to corresponding FeildID's of Record.

In my scenarion : let me explain clearly the exact problem

i have a Edit scenario where the customer read the data from mdm table .

For exmaple : User name : "ratnakar" Country :" India ". Districit" "Bangalore " are read from the Customer record .

At front end side end user removed the District name and Country ,now both values in UI side are empty . When the user click on update button the values at mdm side should be set with blank as the user deleted at front end side.

At the time update i am checking the UI fields i.e if( district!=null) set its FieldValue to cust Record

same for country also .

But in my case it is not replacing the data at mdm side with Blanks . After record updation still showing same values i.e . DistrictName" Bangalore" country name" India"..

Could any body reply to this thread if you come across this situation any where

Regards

dushyant

Former Member
0 Kudos

Hi Dushyant,

You can use the conditon as given below:

if(wdContext.currentContextElement().getName_personal()!=null)

{

newRec.setFieldValue(fields[1], new StringValue(wdContext.currentContextElement().getName_personal()));

}

else

{

newRec.setFieldValue(fields[1], NullValue.NULL);

}

This will update value to blank if there is no value entered using UI.

Hope this helps!!

Cheers,

Arafat

Former Member
0 Kudos

Hi Dushyant,

Please have a look on my previous reply,

if value is null or empty in change scenario , use NullValue.Null as a value.

record.setFieldValue(fieldId, NullValue.Null);

Cheers,

Veeru.

Former Member
0 Kudos

Hi ,

Its got resolved

Former Member
0 Kudos

Hi Dushyant,

You can ue a blank string "" for setting the text field values to blank in MDM. For Lookup Flats, you need to pass RecordId object for string "R0". i,e. new RecordId("R0") in the value for lookup flat field.

Hope this helps!!

Cheers,

Arafat