cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching Doc type in Contract Create

0 Kudos

Hi Experts,

I am facing the problem during fetching the document type of current document in Contract Create script.

My requirement is, I want to restrict user from creating 1st document other than "Contract".

for this i need to fetch the doc type of current document.

I am using following piece of code in Contract Create script but it is throwing me an error.

I am unable to access netviewer JAVA logs due to some technical problem, so I am unable to paste complete log information.

Please help me with your expert comments.

Regards

Nishant

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Sonu Kumar,

Thanks. I tried this in Contract validate script (target validate). but it is restricting me from adding other contract document having doc type Amendment, after adding first document as 'Contract'

former_member227405
Participant
0 Kudos

Hi Nishant,

Then You have to put the validation on Master agreement class Id 1004.

First get all the contract Doc type:contractDcoument= doc.getContractDocuments();

and then check only for first Doc type which already created or going to create.

Thanks

Sonu

Answers (1)

Answers (1)

former_member227405
Participant
0 Kudos

Hi Nishant,

Please try this hope it will help.

if(hasValue(doc.getDocTypeReference().getDisplayName()) )

{

if(!("Contract").equals(doc.getDocTypeReference().getDisplayName()))

{

//exception--for equal conddition , left should not be null becuase it encounters from left in Uf

}

//Please vlaidate this on Target as "Validated"

Thanks

Sonu