cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning status while creating document -Cfolders

Former Member
0 Kudos

Hi,

I am creating a document using following FM .But my status is BLANK.

I want to be one of the status : Requested/Responded...etc..How do we take care of this.

CALL FUNCTION 'CFX_API_DOC_DOCUMENT_WRITE'
    DESTINATION rfcdest
    EXPORTING
      i_doc_id                       = key_document
*     I_VERSION_NAME                 =
*     I_VERSION_DESCRIPTION          =
*     I_CHANGE_CURRENT_VERSION       = CFXA0_SC_FALSE
*     I_BACKEND_SYSTEM               =
      i_file_path                    = fname
      i_file_size                    = fsize
*     I_MIME_TYPE                    =
*     I_CONTENT_URL                  =
*     I_CONTENT_PROXY                =
*     I_CONTENT_PROXYPORT            =
   IMPORTING
*     ES_FAULT                       =
      e_faultstring                  = fault
      e_doc_version_id               = key_version
      e_version_name                 = vname
*     E_CONTENT_RELATIVE_URL         =
    TABLES
      it_content                     = p_image[].

Rgds

Vara

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Vara,

To change the status of an object you got to use FM CFX_API_OBJECT_STATUS_CHANGE.

I_OBJECT_ID - GUID of the document

I_STATUS_ID - GUID of the status

I_NTF_SUBJECT - Subject line of the notification email

I_NTF_COMMENT - Text of the notification email

IT_RECIPIENTS - User ids of receipients.

Regards

Debaranjan.

Former Member
0 Kudos

Debaranjan,

My object doesn't have a status at all.This field is empty.

I need to create a new status.

Rgds

vara

Former Member
0 Kudos

Dear Vara,

Sorry. I thought you already had assigned a status and wanted to change the status through a program.

To assign a status to an object first create the status profile in cFolders. Then use FM CFX_API_STATUS_PROFILE_ASSIGN to assign the status profile to the object.

The parameters you need to pass to CFX_API_STATUS_PROFILE_ASSIGN

I_PROFILE_ID - GUID of the profile

I_OBJECT_ID - GUID of the object

I_ASSIGN_TO_CHILDREN - 'yes' if you want to assign the status profile to the child objects of the object.

Finding the GUID of the status profile is through FM CFX_API_STATUS_PROFILE_GETLIST. It returns a list and the GUIDs of all status profiles in use in the system.

Hope it helps.

Regards,

Debaranjan

Former Member
0 Kudos

Debranjan,

Thank you for your reply.

I am following your instructions.

cFolders:Client.ObjectStatusError.profile_not_for_object_type

This is what I am doing.

First I am creating folder first using

CALL FUNCTION 'CFX_API_DOC_CREATE'
    DESTINATION RFCDEST
    EXPORTING
      i_parent_folder_id         = key_folder
      i_type_id                  = 'doc'

and then writing

CALL FUNCTION 'CFX_API_DOC_DOCUMENT_WRITE'
    DESTINATION RFCDEST
    EXPORTING
      i_doc_id                       = key_document
  i_file_path                    = fname
      i_file_size                    = fsize

I am getting an error saying

cFolders:Client.ObjectStatusError.profile_not_for_object_type

What should be I choosing ? I need to give user custom status profile which will have 1-DRAFT 2-REQUESTED 3- SUBMITTED etc..

Rgds

Vara

Former Member
0 Kudos

Dear Vara,

Status profiles can be restricted to be used with different object types in cFolders. For example you can specify that a certain status profile can be used only with Collaborations and not with Folders or Documents.

From the error that has occured I assume that the status profile you have created is restricted to be used with certain object types only and Documents is not one of them. In cFolders in Status Management open the status profile and check under 'Restrict' tab. If the tab is disabled then you'll have to remove all associations of the profile with any other object.

Let me know if it worked.

Regards,

Debaranjan.

Former Member
0 Kudos

Debranjan,

You were exactly right!.

We have custom template type where it was using only that type.Also what I noticed is we cannot change the can be used because it is already being used in some projects.

Is there anyway we can add a type document to the existing profile?

Or should I start creating a new status profile ? if so how can we transport it? Reason is

In dev portals If I go to Design Collaboration/Status management/ I can see CREATE/COPY/DELETE etcu2026 but I donu2019t see the same in QA.

It worked!! finally I had some profile issues in QA portal..So I have created a new status profile with type Document and now got this profile ID from CFX_API_STATUS_PROFILE_GETLIST and tried assigning this to that document.

Wow!! what a fun!! i am awarding you full 10 points.

Rgds

vara

Edited by: Vara K on May 21, 2009 8:24 PM

Former Member
0 Kudos

Dear Vara,

Glad it worked. Thanks.

Regards,

Debaranjan.

Answers (0)